/**
 * Created by dell on 2018/12/5.
 */
/*
写文件操作
 fs.writeFile(file, data[, options], callback)
 file是文件名
 data是写入的内容

 */
const fs = require('fs');
const path = require('path');

// fs.writeFile('data.txt','hello nihao',(err)=>{
//     console.log(err);
// });

// let statpath = path.join(__dirname,'data.txt');
// fs.writeFile(statpath,'hello nihao',(err)=>{
//     console.log(err);
// });


//同步操作
fs.writeFileSync('data.txt','wodemaya');
